/**
 * 知识图谱 knowledge graph api
 */

import axios from '@/api/http'

// 天地图 行政区搜索服务 (和gis通用接口)
export const searchAdministrativeApi = (options?: any) =>
  axios.request({
    ...options,
    method: 'get',
    url: 'https://api.tianditu.gov.cn/administrative',
  })
// 获取图层数据 geojson (和gis通用接口)
export const plotLayerByGeoJsonApi = (options?: any) =>
  axios.request({
    ...options,
    url: '/gis/plotLayerByGeoJson',
  })

export const queryKnowledgeGraph = (options?: any) =>
  axios.request({
    ...options,
    url: '/knowledge-graph/query',
  })

export const searchKnowledgeGraph = (options?: any) =>
  axios.request({
    ...options,
    url: '/knowledge-graph/search',
  })

export const expandVertice = (options?: any) =>
  axios.request({
    ...options,
    url: '/knowledge-graph/expand',
  })

export const queryByUserId = (options?: any) =>
  axios.request({
    ...options,
    url: '/KGraph/queryByUserId',
  })

export const queryByProjectId = (options?: any) =>
  axios.request({
    ...options,
    url: '/knowledge-graph/queryByProjectId',
  })

export const collapseVertice = (options?: any) =>
  axios.request({
    ...options,
    url: '/knowledge-graph/collapse',
  })

export const bindProject = (options?: any) =>
  axios.request({
    ...options,
    url: '/knowledge-graph/bindProject',
  })

export const unbindProject = (options?: any) =>
  axios.request({
    ...options,
    url: '/knowledge-graph/unbindProject',
  })

export const queryPanelInfoByVid = (options?: any) =>
  axios.request({
    ...options,
    method: 'GET',
    url: '/knowledge-graph/queryPanelInfoByVid',
  })

//  update entity info
export const updatePanelInfoByVid = (options?: any) =>
  axios.request({
    ...options,
    url: '/knowledge-graph/updatePanelInfoByVid',
  })

//  reset entity info
export const resetPanelInfoByVid = (options?: any) =>
  axios.request({
    ...options,
    url: '/knowledge-graph/resetPanelInfoByVid',
  })

export const getData = (options?: any) =>
  axios.request({
    ...options,
    url: '/widget/render/getData',
  })

/**
 * 更新chart信息
 */
export const updateWidget = (options?: any) =>
  axios.request({
    ...options,
    url: '/widget/update',
  })

// 获取 DashBoard
export const queryKGDashBoardApi = (options?: any) =>
  axios.request({
    ...options,
    method: 'GET',
    url: '/knowledge-graph/queryKGDashBoard',
  })
// 更新 DashBoard
export const dashboardUpdateApi = (options?: any) =>
  axios.request({
    ...options,
    url: '/dashboard/update',
  })
export const updateGisInfoApi = (options?: any) =>
  axios.request({
    ...options,
    url: '/knowledge-graph/updateGisInfo',
  })
export const knowledgeGraphPublishApi = (options?: any) =>
  axios.request({
    ...options,
    url: '/knowledge-graph/publish',
  })

export default {}
